<template>
	<!-- 我的配件询价 -->
	<view class="u-wrap">
		<!-- 搜索 -->
		<view class="searchfor">
			<u-search @search="search" v-model="keyword" :show-action="false" placeholder="输入配件名称或OE号搜索" height="66" bg-color="#fff"
			 :clearabled="true"></u-search>
		</view>
		<!-- 车型 -->
		<view class='car-wrap'>
			<car-info :classFlag="shifouhuad" :carInfo="carInfo" type="next"></car-info>
		</view>
<!--筛选-->
     <u-sticky offset-top="124" @fixed="sticky(true)" @unfixed="sticky(false)" bg-color="none">
       <view  class="choose-group" :class="{'padding-24': isSticky, 'margin-24': !isSticky, 'down-open': isOpen, 'down-close': !isOpen}">
         <u-dropdown active-color="#FDD421" ref="uDropdown" @open="open" @close="close" :borderBottom="false"
                     duration="200">
           <u-dropdown-item title="综合排序" :options="sortList" v-model="sort" height="330rpx"></u-dropdown-item>
           <u-dropdown-item title="品质" :options="characterTypeList" v-model="characterType" height="550rpx"></u-dropdown-item>
           <u-dropdown-item title="供应商" :options="supplierList" v-model="supplier" height="110rpx"></u-dropdown-item>
         </u-dropdown>
       </view>
    </u-sticky>
<!--    配件列表-->

		<view class="u-menu-wrap">
			<!-- 左 -->
			<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" >
				<view v-for="(item,index) in carPartDetails" :key="index" class="u-tab-item" :class="[current === index ? 'u-tab-item-active' : '']"
				 :data-current="index" @click.stop="swichMenu(item,index)">
					{{item.part_Category_Name}}
				</view>
			</scroll-view>
<!-- 右 -->
			<block>
				<scroll-view scroll-y class="right-box" v-if="carPartDetails.length > 0">
					<view class="page-view" v-for="(item,index) in carPartDetails" :key="index">
						<view v-show="current === index && item.carPartOfferList.length > 0" class="right-box-card">
							<view class="ziliao">
								<view class="zilbox1">
									<view class="zilname1">
										{{item.part_Category_Name}}
									</view>
								</view>
							</view>
							<view class="quote-item" v-for="(item1, index1) in item.carPartOfferList" :key="index1" @click="selectedclick(index, index1)">
									<view class="xiafabox flex flex-jc-sb flex-ai-c">
										<view class="xfyc">
											{{characterList[item1.character_Type]}}
										</view>
                    <i-icon v-show="selQuoteArr[index][index1].isChecked" icon="icongouxuan" type="multiple" size="40rpx"></i-icon>
                    <i-icon v-show="!selQuoteArr[index][index1].isChecked && !item1.is_Purchase" icon="icontuoyuan" type="single" size="40rpx" color="#999999"></i-icon>
									  <view v-if="item1.is_Purchase" class="buy-flag">已下单</view>
                    <view v-if="item1.is_Purchase" class="buy-flag-modal"></view>
                  </view>
									<view class="storname">
										{{item1.store_Name}}
									</view>
									<view class="addredss">
										地址：{{item1.cityName}}
									</view>
									<view class="moneys">
										￥{{item1.offer_Price}}
                    <text class="num">x{{ item1.purchase_Number}}</text>
									</view>
									<view class="baoimg flex ">
                    <view @click.stop="chat(item1)" >
											<i-icon icon="iconxiaoxi1" class="baoimg-icon1" type='multiple'  size='34rpx' ></i-icon>
                    </view>
                    <view @click.stop="call(item1.store_Phone)">
											<i-icon icon="icondianhua"  type='multiple'  size='34rpx' ></i-icon>
                    </view>
											<i-icon v-if="item1.deposit_balance > 0" class="baoimg-icon1" icon="iconbao_1"  type='single'  size='34rpx' color="#eb5c02"></i-icon>
									</view>
									<view class="beizhu" v-show="item1.remarks">
										商家备注：{{item1.remarks}}
									</view>
							</view>
						</view>
            <default-img v-show="current === index && item.carPartOfferList.length === 0" msg="此配件没有符合条件的报价"></default-img>
          </view>
				</scroll-view>
			</block>
		</view>
		<view class="quedingbtn flex flex-ai-c">
			<view class="hejibox">
				<view class="heji">
					合计： 已选
					<text>{{selNum}}</text>/{{carPartDetails.length}}
				</view>
				<view class="hejiqian">
					￥{{TotalPayMoney}}
				</view>
			</view>
			<button class="agreeBtn" @click="confirm">立即下单</button>
		</view>
	</view>
</template>
<script src="./orderAccessory.js"></script>
<style lang="scss" scoped>
	@import './orderAccessory.scss';
</style>
